<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<script type="text/javascript" src="libs/jquery-1.11.0.js"></script>
		<script type="text/javascript" src="pub/JSCommonUtil.js"></script>
		<title>表单全新自动化渲染</title>
	</head>


	<body>
		<div id="father">
			
		</div>
		<!-- 33{{new Date|filter}}33 -->
		<!-- {{a.b}} -->
		<script type="text/javascript">
		var session={};
		$(function(){
			var data={
				"custom_fields" : [ 
			        {
			            "cols" : [ 
			                {
			                    "fields" : [ 
			                        {
			                            "name" : "复选框",
			                            "type" : "checkbox",
			                            "_id" : "00f19590-f071-11e3-bb9d-8b58a02a7843",
			                            "required" : "no",
			                            "default" : [ 
			                                ""
			                            ],
			                            "dic" : "71003810-f070-11e3-bb9d-8b58a02a7843"
			                        }
			                    ]
			                }, 
			                {
			                    "fields" : [ 
			                        {
			                            "name" : "单选框",
			                            "type" : "radio",
			                            "_id" : "00f19591-f071-11e3-bb9d-8b58a02a7843",
			                            "required" : "no",
			                            "default" : "",
			                            "dic" : "71003810-f070-11e3-bb9d-8b58a02a7843"
			                        }
			                    ]
			                }
			            ]
			        }, 
			        {
			            "cols" : [ 
			                {
			                    "fields" : [ 
			                        {
			                            "name" : "多行文本",
			                            "type" : "multi",
			                            "_id" : "00f19592-f071-11e3-bb9d-8b58a02a7843",
			                            "required" : "0",
			                            "default" : "",
			                            "dic" : ""
			                        }, 
			                        {
			                            "name" : "单行文本",
			                            "type" : "single",
			                            "_id" : "b9de5360-b97e-11e3-b4a2-7d585caca2c0",
			                            "required" : "no",
			                            "default" : "",
			                            "dic" : ""
			                        }
			                    ]
			                }
			            ]
			        }, 
			        {
			            "cols" : [ 
			                {
			                    "fields" : [ 
			                        {
			                            "name" : "省",
			                            "type" : "dropdown",
			                            "_id" : "00f19593-f071-11e3-bb9d-8b58a02a7843",
			                            "required" : "no",
			                            "default" : "",
			                            "dic" : "46ad1a60-a2a5-11e3-bbdd-89b76649beb8"
			                        }
			                    ]
			                }, 
			                {
			                    "fields" : [ 
			                        {
			                            "name" : "市",
			                            "type" : "dropdowncc",
			                            "_id" : "00f19594-f071-11e3-bb9d-8b58a02a7843",
			                            "required" : "0",
			                            "default" : "",
			                            "dic" : "46ad1a60-a2a5-11e3-bbdd-89b76649beb8_1"
			                        }
			                    ]
			                }, 
			                {
			                    "fields" : [ 
			                        {
			                            "name" : "数字文本",
			                            "type" : "number",
			                            "_id" : "00f19595-f071-11e3-bb9d-8b58a02a7843",
			                            "required" : "0",
			                            "default" : "",
			                            "dic" : ""
			                        }
			                    ]
			                }
			            ]
			        }
			    ],
			    dropDown:[{
			    	key:"k1",
			    	value:"v1"
			    },{
			    	key:"k2",
			    	value:"v2"
			    }]
			}
			jc.filters.formElem=function(value){
				if(~value.indexOf("dropdown")){
					return "select"
				}
				if(value=== 'multi'){
					return "textarea"
				}
				return "input"
			}

			
			jc.render(data,"formAutoRender",$('#father'),function(th){
				console.log("OK");

			})

		})
		</script>
	</body>
</html>